import { Empty, EmptyProps } from "antd";
import imgError from "./svg/error.svg";
import imgNotFind from "./svg/not_find.svg";
import "./index.less";
import { FC } from "react";

interface NotFindProps extends EmptyProps {
  isError?: boolean;
}

export const NotFind: FC<NotFindProps | undefined> = (props) => {
  const { isError = false, className = "", ...rest } = props || {};
  const defaultProp = !isError
    ? {
        description: <div className="desc">未找到数据</div>,
        image: imgNotFind,
      }
    : {
        description: <div className="desc">系统错误</div>,
        image: imgError,
      };
  return (
    <>
      <Empty
        className={"hy_empty_img_not_find h100 " + className}
        {...defaultProp}
        {...rest}
        imageStyle={{
          width: 224,
          height: 213,
        }}
      />
    </>
  );
};
export default NotFind;
/** 系统错误 */
export const Error: FC<EmptyProps> = (props) => {
  return (
    <>
      <NotFind isError {...props} />
    </>
  );
};
